package com.huarui.web;


import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.huarui.entity.Student;
import com.huarui.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 * 参考博客->https://blog.csdn.net/u014745069/article/details/80783122
 * @author lihui
 * @since 2018-10-22
 */
@Controller
@RequestMapping("/student")
public class StudentController {


    @Autowired
    private IStudentService studentService;


    /**
     * 测试是否可以正常使用!
     * @return
     */
    @GetMapping(value = "/show")
    public @ResponseBody JSONObject testEnum() {
        Page<Student> Students = studentService.selectPage(new Page<>(1, 10));
        JSONObject result = new JSONObject();
        result.put("Student", Students);
        return result;
    }

}
